package 迭代器模式;

public class main {
    public static void main(String[] args) {
        Collection collection = new ListCollection();
        collection.add("object1");
        collection.add("object2");
        Iterator iterator = collection.iterator();
        while (iterator.hasNext()){
            System.out.println(iterator.next());
        }
    }
}
